// ListViewDialog.h

#ifndef __LISTVIEW_DIALOG_H
#define __LISTVIEW_DIALOG_H

#include "resource.h"

#include "../../../Common/MyFixes.h"

class CListViewDialog: public CDialogImpl<CListViewDialog>
{
	public:
	enum { IDD = IDD_DIALOG_LISTVIEW};

	BEGIN_MSG_MAP(CListViewDialog)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		MESSAGE_HANDLER(WM_SIZE, OnSize)
		MESSAGE_HANDLER(WM_NOTIFY, OnNotify)
		COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
		COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
	END_MSG_MAP()
  LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
  LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
  LRESULT OnNotify(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/);
  
  LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
	{
		FocusedItemIndex = _listView. GetNextItem(-1, LVNI_FOCUSED);
		EndDialog(wID);
		return 0;
	}

  CListViewCtrl _listView;
  
  
public:
  CString Title;
  bool DeleteIsAllowed;
  bool StringsWereChanged;
  CStringVector Strings;
  int FocusedItemIndex;
    

  CListViewDialog(): DeleteIsAllowed(false) {}
};

#endif
